﻿using System.Web.Mvc;

namespace GiaoXuLanTranh_MucVu.Areas.AdminCP
{
    public class AdminCPAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "AdminCP";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                "AdminCP_default",
                "AdminCP/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional }
            );

        }

        //public override void RegisterArea(AreaRegistrationContext context)
        //{
        //    string[] files = Directory.GetFiles(HttpContext.Current.Server.MapPath("~/Bin"), "Class.Controllers.AdminCP.*.dll");
        //    string[] namespaces = new string[files.Length];
        //    for (int i = 0; i < files.Length; i++)
        //    {
        //        namespaces[i] = Path.GetFileNameWithoutExtension(files[i]);
        //    }
        //    context.MapRoute("AdminCP_default", "AdminCP/{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = UrlParameter.Optional }, namespaces);
        //}

        //// Properties
        //public override string AreaName
        //{
        //    get
        //    {
        //        return "AdminCP";
        //    }
        //}


    }
}
